name: build image
on: [push]

jobs:
  build:
    runs-on: cth-ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Get version
        id: vars
        run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
      - name: Build and push to registry
        id: push
        uses: mr-smithers-excellent/docker-build-push@v6
        with:
          registry: gitea.realmanual.ru
          image: ${{ env.GITHUB_REPOSITORY }}
          username: ${{ env.GITHUB_ACTOR }}
          password: ${{ secrets.TOKEN }}
          multiPlatform: true
          platform: linux/amd64,linux/arm64
          buildArgs: |
            DOCKER_BASEIMAGE=alpine
          tags: ${{ steps.vars.outputs.version }}
          addLatest: true
